function iconType( diaryType, photoFilename, movieFilename )
{
	if( diaryType == 1 ) // 수유
		return "url(../images/diaryicon/icon_milk.png), url(../images/mainframe/post_photo_frame.png), url(../images/mainframe/post_bg.png)";
	else if( diaryType == 4 ) // 수면
		return "url(../images/diaryicon/icon_sleep.png), url(../images/mainframe/post_photo_frame.png), url(../images/mainframe/post_bg.png)";
	else if( diaryType == 5 || diaryType == 6 )
		return "url(../images/diaryicon/icon_poo.png), url(../images/mainframe/post_photo_frame.png), url(../images/mainframe/post_bg.png)";
	else if( diaryType == 7 )
		return "url(../images/diaryicon/icon_bath.png), url(../images/mainframe/post_photo_frame.png), url(../images/mainframe/post_bg.png)";
	else if( diaryType >= 8 && diaryType <= 39 )
		return "url(../images/diaryicon/icon_do.png), url(../images/mainframe/post_photo_frame.png), url(../images/mainframe/post_bg.png)";
	else if( diaryType == 40 )
		return "url(../images/diaryicon/icon_height.png), url(../images/mainframe/post_photo_frame.png), url(../images/mainframe/post_bg.png)";
	else if( diaryType == 41 )
		return "url(../images/diaryicon/icon_weight.png), url(../images/mainframe/post_photo_frame.png), url(../images/mainframe/post_bg.png)";
	else if( diaryType >= 42 && diaryType <=49 )
		return "url(../images/diaryicon/icon_teeth.png), url(../images/mainframe/post_photo_frame.png), url(../images/mainframe/post_bg.png)";
	else if( photoFilename != null )
		return "url(../images/diaryicon/icon_photo.png), url(../images/mainframe/post_photo_frame.png), url(../images/mainframe/post_bg.png)";
	else if( movieFilename != null )
		return "url(../images/diaryicon/icon_movie.png), url(../images/mainframe/post_photo_frame.png), url(../images/mainframe/post_bg.png)";
	else
		return "url(../images/diaryicon/icon_do.png), url(../images/mainframe/post_photo_frame.png), url(../images/mainframe/post_bg.png)";
}

function urlPhoto( babyId, filename )
{
	if (filename == null || filename == "" )
		return "";

	return 'url('+serverURL+'/photo/'+babyId+'/post_'+filename+')';
}

function urlProfilePhoto( id, filename, type )
{
	if ( filename == null || filename == "")
		return "";
	
	if( type == 'small' )
		return 'url('+serverURL+'/photo/'+id+'/'+'Small_'+filename+')';
	else if( type == 'medium' )
		return 'url('+serverURL+'/photo/'+id+'/'+'Medium_'+filename+')';
	else if( type == 'large' )
		return 'url('+serverURL+'/photo/'+id+'/'+'Large_'+filename+')';
}

// 부모냐 가족이냐
function urlProfileFrame( selectURL, type, gender )
{
	var url;

	if(selectURL == 1 )
		url = "../";
	else 
		url = "../../";

	if( type == 1 ){
		if( gender == 1 )
			return 'url('+url+'images/mainframe/sum_small_papa.png)';
		else if( gender == 2 )
			return 'url('+url+'images/mainframe/sum_small_mam.png)';
	}else if( type == 2 ){
		return 'url('+url+'images/mainframe/sum_small_family.png)';
	}else{
		return 'url('+url+'images/mainframe/sum_small_baby.png)';
	}
}

function urlMediumFrame( type, gender )
{
	if( type == 1 )
	{
		if( gender == 1 )
			return 'url(../images/list/sum_medium_papa.png)';
		else if( gender == 2 )
			return 'url(../images/list/sum_medium_mam.png)';
	}else if( type == 2 ){
		return 'url(../images/list/sum_medium_family.png)';
	}else{
		return 'url(../images/list/sum_medium_baby.png)';
	}
}

function countDay( birthday )
{
	//var temp_birthday = new Date( birthday );
	var temp_birthday = myDateFormat( birthday );
	var temp_now = new Date();
	var temp_gap = temp_now.getTime() - temp_birthday.getTime();
	temp_gap = Math.ceil( temp_gap / (1000 * 60 * 60 * 24) );
	return temp_gap*1+1;
}

function showAfterTime( thatTime )
{
	//var temp_birthday = new Date( birthday );
	var temp_birthday = myDateFormat( birthday );
	var temp_now = new Date();
	var temp_gap = temp_now.getTime() - temp_birthday.getTime();
	temp_gap = Math.floor( temp_gap / (1000 * 60 * 60 * 24) );
	return temp_gap;
	var now = new Date();
	var gap = now - thatTime;
}


function checkGender( selectUrl, genderType )
{
	var url;
	if( selectUrl == 1 )
		url = "../images/profile/";
	else
		url = "../../images/profile/";

	if( genderType == "1" )
		return url+"gender_male.png";
	else
		return url+"gender_female.png";
}

function checkSimilarity( similarity )
{
	if( similarity == null || similarity == 0 )
		return '00.0';
	else
		return similarity.substr(0,4);
}

function refreshNewsBtn( news_exist )
{
	if( news_exist > 0 ) $("#btnHeaderNew").css("background-image", "url(../images/mainframe/btn_new_on.png)");
	else $("#btnHeaderNew").css("background-image", "url(../images/mainframe/btn_new.png)");
}

function btnClear()
{
	$("#tab1").attr({src:"../images/tab/tab_1.png"});
	$("#tab2").attr({src:"../images/tab/tab_2.png"});
	$("#tab3").attr({src:"../images/tab/tab_3.png"});
	$("#tab4").attr({src:"../images/tab/tab_4.png"});
	$("#tab5").attr({src:"../images/tab/tab_5.png"});
}

function invisibleImage()
{
	$("#imgDetail").css("display", "none");
}